WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WTextEdit",function(m,b){jQuery.data(b,"obj",this);var o,p,q=0,r=this,c=m.WT,s;if(!tinymce.dom.Event.domLoaded)tinymce.dom.Event.domLoaded=true;tinyMCE.init({mode:"none"});this.render=function(a,g,d){s=g;b.ed=new tinymce.Editor(b.id,a,tinymce.EditorManager);b.ed.render();if(d)tinymce.EditorManager.majorVersion<4?b.ed.onChange.add(function(){m.emit(b,"change")}):b.ed.on("change",function(){m.emit(b,"change")});m.emit(b,"render")};this.init=function(){var a=
c.getElement(b.id+"_ifr"),g,d;if(tinymce.EditorManager.majorVersion<4){d=g=a.parentNode.parentNode.parentNode.parentNode;g=g.parentNode}else g=a.parentNode.parentNode.parentNode;if(d){d.style.cssText="width:100%;"+s;b.style.height=d.offsetHeight+"px"}g.wtResize=b.wtResize;c.isGecko?setTimeout(function(){r.wtResize(b,o,p)},100):r.wtResize(b,o,p);$((c.isIE?document.frames[a.id].document:a.contentDocument).body).bind("paste",function(k){function e(n){return n.indexOf("image/")==0}var f=k.clipboardData||
k.originalEvent.clipboardData,i,l;if(f&&f.types){i=0;for(l=f.types.length;i<l;++i)if(e(f.types[i])||e(f.items[i].type)){var j=f.items[i].getAsFile(),h=new FileReader;h.onload=function(){b.ed.insertContent('<img src="'+this.result+'"></img>')};h.readAsDataURL(j);c.cancelEvent(k)}}})};this.wtResize=function(a,g,d){if(!(d<0)){var k=c.getElement(a.id+"_ifr");if(k){var e=0,f=0;e=c.px(a,"marginLeft")+c.px(a,"marginRight");f=c.px(a,"marginTop")+c.px(a,"marginBottom");if(!c.boxSizing(a)){e+=c.px(a,"borderLeftWidth")+
c.px(a,"borderRightWidth")+c.px(a,"paddingLeft")+c.px(a,"paddingRight");f+=c.px(a,"borderTopWidth")+c.px(a,"borderBottomWidth")+c.px(a,"paddingTop")+c.px(a,"paddingBottom")}a.style.height=d-f+"px";var i;f=b.style.position!=="absolute";if(tinymce.EditorManager.majorVersion<4){var l=k.parentNode.parentNode,j=l.parentNode.parentNode,h,n;i=j;e=j.parentNode;if(!f&&typeof g!=="undefined")e.style.width=g-2+"px";h=0;for(n=j.rows.length;h<n;h++)if(j.rows[h]!=l)d-=j.rows[h].offsetHeight}else{l=k.parentNode;
j=l.parentNode;e=j.parentNode;if(!f&&typeof g!=="undefined")e.style.width=g-2+"px";h=0;for(n=j.childNodes.length;h<n;h++)if(j.childNodes[h]!=l)d-=j.childNodes[h].offsetHeight+1;d-=1}if(d<0){if(q<10){a=Math.pow(2,q)*100;setTimeout(function(){r.wtResize(b,o,p)},a)}q+=1}else{d+="px";if(f){e.style.position="static";e.style.display="block"}else{e.style.position=a.style.position;e.style.left=a.style.left;e.style.top=a.style.top;if(!f&&i)i.style.width=g+"px";if(i){i.style.height=d+"px";e.style.height=a.style.height}}if(k.style.height!=
d){q=0;k.style.height=d;m.layouts2&&m.layouts2.setElementDirty(b)}}}else{o=g;p=d}}};p=b.offsetHeight;o=b.offsetWidth});
